home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / LIB / PRED_NOT.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.4 KB  |  78 lines

  1.  
  2. package sub_arctic.lib;
  3.  
  4. /** 
  5.  * Interactor predicate class that does an NOT operation across the results of
  6.  * another interactor_pred objects it is composed out of.  
  7.  *
  8.  * @see sub_arctic.lib.base_interactor#traverse_and_collect
  9.  * @author Scott Hudson
  10.  */
  11. public class pred_not implements interactor_pred {
  12.  
  13.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  14.  
  15.   /** Component predicate. */
  16.   protected interactor_pred _op1 = null;
  17.  
  18.   /** 
  19.    * Component predicate. 
  20.    * @return interactor_pred the predicate we are built from.
  21.    */
  22.   public interactor_pred op1() {return _op1;}
  23.  
  24.   /** 
  25.    * Set component predicate. 
  26.    * @param interactor_pred p the predicate we are to be built from.
  27.    */ 
  28.   public void set_op1(interactor_pred p) {_op1 = p;}
  29.  
  30.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  31.  
  32.   /** 
  33.    * Construct new predicate from another predicate 
  34.    * @param interactor_pred p the predicate we are to be built from.
  35.    */
  36.   public pred_not(interactor_pred p1)
  37.     {
  38.       set_op1(p1);
  39.     }
  40.  
  41.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  42.  
  43.   /** Perform the predicate test by inverting the result of the component 
  44.    *  predicate.  
  45.    *  
  46.    *  @param obj        the interactor the predicate is testing.
  47.    *  @param parameters the additional parameters (of subclass specific type)
  48.    *                    to the component predicate.
  49.    *  @return NOT of result from the component predicate.
  50.    */
  51.   public boolean test(interactor obj, Object parameters) 
  52.     {
  53.       return !op1().test(obj, parameters);
  54.     }
  55.  
  56.    //had:
  57.    //*  @exception sub_arctic.exception.bad_value thrown if the parameters 
  58.    //*     parameter is not the proper type for the component predicate.
  59.  
  60.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  61. }
  62. /*=========================== COPYRIGHT NOTICE ===========================
  63.  
  64. This file is part of the subArctic user interface toolkit.
  65.  
  66. Copyright (c) 1996 Scott Hudson and Ian Smith
  67. All rights reserved.
  68.  
  69. The subArctic system is freely available for most uses under the terms
  70. and conditions described in 
  71.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  72. and appearing in full in the lib/interactor.java source file.
  73.  
  74. The current release and additional information about this software can be 
  75. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  76.  
  77. ========================================================================*/
  78.